<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <!-- 推荐列表 -->
    <ul>
      <router-link tag='li'
        class="item border-bottom"
        v-for="item in recommendList"
        :key="item.id"
        :to="`/detail/${item.id}`"
      >
        <img class="item-img" :src="item.imgUrl" />
        <div class="item-info-wrapper">
          <p class="item-info-title">{{ item.title }}</p>
          <p class="item-info-desc">{{ item.desc }}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Recommend",
  props: {
    recommendList: {
      type: Array
    }
  },
  data() {
    return {};
  }
};
</script>

<style lang="less" scoped>
@import "~@/assets/styles/mixins.less";
.recommend-title {
  height: 0.8rem;
  margin-top: 0.1rem;
  line-height: 0.8rem;
  background-color: #eee;
  text-indent: 0.2rem;
}
.item {
  display: flex;
  height: 1.7rem;
  padding: 0.2rem;
  //   border-bottom: 1px solid #eee;
  &-img {
    width: 1.68rem;
    margin-right: 0.2rem;
  }

  &-info-wrapper {
    flex: 1;
    min-width: 0;
  }
  &-info-title {
    line-height: 0.54rem;
    font-size: 0.32rem;
    font-weight: 700;
    .text-hidden();
  }
  &-info-desc {
    line-height: 0.4rem;
    color: #ccc;
    .text-hidden();
  }
  &-button {
    margin-top: 0.16rem;
    padding: 0 0.2rem;
    background-color: #ff9300;
    color: #fff;
    border-radius: 0.06rem;
    line-height: 0.44rem;
  }
}
</style>
